/**
 * 对话框基类
 */
var Dialog = View.extend({
    _actionType: ViewActionType.Scale,
    _blockBack: true,
    _notCloseBlock: true,
    /**
     * 初始化只调用一次
     * @public
     */
    initDialog: function () {
    },
    /**
     * 刷新数据，外部调用setData
     */
    refreshData: function () {
    },
    /**
     * 刷新界面数据
     * @protected
     */
    _refreshData: function () {
        var self = this;
        if (!self._isInit) {
            //屏幕居中
            this._rootNode.move(display.center);
            this._addCloseBtn();
            this.initDialog.apply(this, arguments);
            self._isInit = true;
        }
        self.refreshData.apply(this, arguments);
    },
    /**
     * 关闭按钮
     * @private
     */
    _addCloseBtn: function () {
        var self = this;
        var closeBtn = this._nodeList['btn_back'] || this._nodeList['_btn_back'];
        if (closeBtn) {
            TouchUtil.setOnclickListener(closeBtn, function () {
                self.removeFromParent(true);
            }, {effect: TouchUtil.effects.NONE});
        }
    }
});